package com.lry.rpc.netty.server;

import com.lry.rpc.config.NettyServerConfig;
import com.lry.rpc.netty.Disposable;


public class RpcServer implements Disposable, RemotingServer {


    private NettyServerConfig nettyServerConfig;

    public RpcServer(){
        this(new NettyServerConfig());
    }

    public RpcServer(NettyServerConfig nettyServerConfig){
        this.nettyServerConfig = nettyServerConfig;
    }

    @Override
    public void start(){
        RpcServerBootstrap rpcServerBootstrap = new RpcServerBootstrap(this,nettyServerConfig);
        rpcServerBootstrap.start();
    }


    @Override
    public void shutdown() {
        destroy();
    }

    @Override
    public void destroy() {

    }

    public static void main(String[] args) {
        RpcServer rpcServer = new RpcServer();
        rpcServer.start();
    }


}
